package org.n.shop.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.n.shop.domain.Do.SelectCommendByCommodityIdDo;
import org.n.shop.domain.entity.Comment;

import java.util.List;

@Mapper
public interface CommentMapper {
    List<SelectCommendByCommodityIdDo> all(@Param("page") int page, @Param("pageSize") int pageSize, @Param("commodityId") int commodityId);

    int total(@Param("commodityId") int commodityId);

    int add(Comment comment);

    int isCommented(@Param("commodityId") int commodityId,
                    @Param("userId") int userId);
}
